<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .container{
      width:500px;
      height:500px;
      background-color: orange;
    }
  .item{
    width:100px;
    height:100px;
    background-color: #f00;
    /* float:left; */
  }
.box1{
  float:left;
  background-color: #0f0;
  margin-left:10px;
}
  .box2{
    float:left;
  }
  .box3{
    float:left;
  }
  .box4{
  float:left;
  width:200px;
  height: 100px;
  background-color: purple;
  
}

  </style>
  
</head>
<body>
  
  <!-- 浮动元素之间不能层叠 -->
  <div class="container">
      <div class="item box1">1</div>
      <div class="item box2">2</div>
      <div class="item box3">3</div>
      <div class="item box4">4</div>



  </div>
  
  
</body>
</html>